﻿using Hotel.Application;
using Hotel.Application.Admins.Dto;
using Hotel.Application.Dics;
using Hotel.Application.Dics.Dto;
using Hotel.Application.Menus;
using Hotel.Application.Menus.Dto;
using Hotel.Domain;
using Hotel.Web.Filters;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using Newtonsoft.Json;

namespace Hotel.Web.Controllers
{
    public class MenuController : BaseController<Menu, MenuCreateUpdateDto, MenuListDto>
    {
        private readonly IMenuService service;

        public MenuController(IMenuService service) : base(service)
        {
            this.service = service;
        }

        [HttpGet]
        public override IActionResult Index()
        {
            return base.Index();
        }

        [HttpGet]
        public async Task<IActionResult> QueryTreeNodes()
        {
            return Json(await service.QueryTreeNodesAsync());
        }
    }
}
